package cn.tedu.sp04.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import pojo.User;
import web.util.JsonResult;

@FeignClient("user-service")
public interface UserClient {

    @GetMapping("/{userId}")
    public JsonResult<User> getUser(@PathVariable("userId") Integer userId);

    @PostMapping("/{userId}/score")
    public JsonResult<?> addScore(@PathVariable("userId") Integer userId, @RequestParam("score") Integer score);

}
